home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3961 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: news.eunet.fi!fipnet!kone!jsaarinen
  2. Newsgroups: comp.sys.amiga.programmer
  3. X-NewsReader: IntuiNews 1.2b (31.7.94)
  4. References: <311e8ed0@lls.se> <38232439@kone.fipnet.fi> <4g0bpp$gh1@maureen.teleport.com>
  5. From: "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi>
  6. Date: Sun, 18 Feb 96 12:45:10 UT
  7. Comments: Illegal date header - new date added by quicknews
  8. X-Original-Date: Sun, 18 Feb 96 12:44:00 
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: binary
  12. Subject: Re: PPC compilers
  13. Message-ID: <38232460@kone.fipnet.fi>
  14.  
  15.  
  16. > : Let us try:
  17. > :        move.w  d2,d4           ;u<<8
  18. > :        move.l  a0,d5           ;g<<8
  19. > :        move.b  d2,d4           ;+v
  20. > :        addx.l  d3,d2           ;u+=ustep
  21. > :        move.b  (a2,d4.w),d5    ;read texel
  22. > :        addx.l  d1,d0           ;v+=vstep
  23. > :        move.b  (a3,d5.l),(a4)+ ;read pixel from the shading table
  24. > :        add.l   a1,a0           ;g+=gstep
  25. >  I think this is faster on all 680x0 and uses 2 less register:
  26. >  (6 free registers for the yloop, and is not bigger in byte size
  27. >  then your version)
  28. >     move.w    d1,d2        ;set texture ypos
  29. >     addx.l    d4,d1        ;step in texture
  30. >     move.b    d0,d2        ;set texture xpos
  31. >     move.l    d2,a0        ;texel address
  32. >     move.l    a2,d2        ;lighting table
  33. >     addx.l    d3,d0        ;step in texture
  34. >     move.b    (a0),d2        ;Set texel in lighting table
  35. >     move.l    d2,a0        ;Get lighting*texel adr in a usable reg
  36. >     move.b    (a0),(a1)+    ; write lighted texel 
  37. >     adda.l    a3,a2        ; next light value
  38.  
  39. Hmm. I guess that "move.l a2,d2" should be .w, because of 64k alignment
  40. of the shading table.
  41.  
  42. But yes, using those 64k aligned tables is 28 cycles instead
  43. of 30. That is only 7% though .. But two more free registers,
  44. that is a great thing. Now, how do we schedule this loop 
  45. for the maximum performance on the 68040 and the 68060?
  46.  
  47.      move.w    d1,d2        ;set texture ypos
  48.      addx.l    d4,d1        ;step in texture
  49.      move.b    d0,d2        ;set texture xpos
  50. ;possible stall?
  51.      move.l    d2,a0        ;texel address
  52.      move.l    a2,d2        ;lighting table
  53.      addx.l    d3,d0        ;step in texture
  54.      move.b    (a0),d2        ;Set texel in lighting table
  55. ;possible stall?
  56.      move.l    d2,a0        ;Get lighting*texel adr in a usable reg
  57.      move.b    (a0),(a1)+    ; write lighted texel 
  58.      adda.l    a3,a2        ; next light value
  59.  
  60. --                               _
  61. a Stellar programmer          _ //
  62. "Amiga - back for the future" \X/
  63.